<HTML>
<BODY BGCOLOR="white">
<PRE>
<FONT color="green">001</FONT>    package org.hackystat.dailyprojectdata.frontsidecache;<a name="line.1"></a>
<FONT color="green">002</FONT>    <a name="line.2"></a>
<FONT color="green">003</FONT>    import static org.junit.Assert.assertNull;<a name="line.3"></a>
<FONT color="green">004</FONT>    import org.hackystat.dailyprojectdata.test.DailyProjectDataTestHelper;<a name="line.4"></a>
<FONT color="green">005</FONT>    import org.junit.Test;<a name="line.5"></a>
<FONT color="green">006</FONT>    <a name="line.6"></a>
<FONT color="green">007</FONT>    /**<a name="line.7"></a>
<FONT color="green">008</FONT>     * Simple test class to make sure FrontSideCaching works. <a name="line.8"></a>
<FONT color="green">009</FONT>     * @author Philip Johnson<a name="line.9"></a>
<FONT color="green">010</FONT>     */<a name="line.10"></a>
<FONT color="green">011</FONT>    public class TestFrontSideCache extends DailyProjectDataTestHelper {<a name="line.11"></a>
<FONT color="green">012</FONT>    <a name="line.12"></a>
<FONT color="green">013</FONT>      /**<a name="line.13"></a>
<FONT color="green">014</FONT>       * Check to make sure FrontSideCache instantiation, put, get, and clear work. <a name="line.14"></a>
<FONT color="green">015</FONT>       */<a name="line.15"></a>
<FONT color="green">016</FONT>      @Test<a name="line.16"></a>
<FONT color="green">017</FONT>      public void testFrontSideCache() {<a name="line.17"></a>
<FONT color="green">018</FONT>    <a name="line.18"></a>
<FONT color="green">019</FONT>        String user = "user";<a name="line.19"></a>
<FONT color="green">020</FONT>        String uri = "uri";<a name="line.20"></a>
<FONT color="green">021</FONT>        String dpd = "dpd";<a name="line.21"></a>
<FONT color="green">022</FONT>        String project = "project";<a name="line.22"></a>
<FONT color="green">023</FONT>        FrontSideCache cache = new FrontSideCache(getDpdServer());<a name="line.23"></a>
<FONT color="green">024</FONT>        cache.put(user, project, uri, dpd);<a name="line.24"></a>
<FONT color="green">025</FONT>        // The following is the most important test. It's commented out because front side caching<a name="line.25"></a>
<FONT color="green">026</FONT>        // is disabled for the rest of testing.  To run the following line, you must edit<a name="line.26"></a>
<FONT color="green">027</FONT>        // ServerProperties, change the test value of TESTFRONTSIDECACHE_ENABLED to true. <a name="line.27"></a>
<FONT color="green">028</FONT>        // Then you can uncomment this line and run the test. <a name="line.28"></a>
<FONT color="green">029</FONT>        // Pretty bogus, but I can't think of a good way around it at the moment. <a name="line.29"></a>
<FONT color="green">030</FONT>        //assertEquals("testing frontside get", dpd, cache.get(user, uri));<a name="line.30"></a>
<FONT color="green">031</FONT>        assertNull("Testing frontside get null", cache.get(user, project, "foo"));<a name="line.31"></a>
<FONT color="green">032</FONT>        cache.clear(user);<a name="line.32"></a>
<FONT color="green">033</FONT>        assertNull("Testing frontside clear", cache.get(user, project, "foo"));<a name="line.33"></a>
<FONT color="green">034</FONT>      }<a name="line.34"></a>
<FONT color="green">035</FONT>    }<a name="line.35"></a>




























































</PRE>
</BODY>
</HTML>
